package cn.cttic.app.mapper;

import cn.cttic.base.api.domain.BaseUser;
import cn.cttic.base.api.domain.vo.BaseUserVo;
import cn.cttic.common.mybatis.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 账户信息Mapper接口
 *
 * @author Times.Studio
 * @date 2024-05-23
 */
public interface BaseUserMapper extends BaseMapperPlus<BaseUser, BaseUserVo> {

    /**
     * 通过用户名查询用户
     *
     * @param userName 用户名
     * @return 用户对象信息
     */
    @Select("SELECT * FROM base_user WHERE user_name = #{username}")
    BaseUser selectUserByUserName(@Param(value = "username") String username);

    /**
     * 通过手机号查询用户
     *
     * @param phonenumber 手机号
     * @return 用户对象信息
     */
    @Select("SELECT * FROM base_user WHERE phone = #{phonenumber}")
    BaseUser selectUserByPhonenumber(@Param(value = "phonenumber") String phonenumber);
}
